﻿@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>
<div class="jumbotron">
    <form action="~/AdminChecklist/SaveUploadedFile" method="post" enctype="multipart/form-data" class="dropzone" id="dropzoneForm" style="background: none; border: none;">
        <div class="fallback">
            <input name="file" type="file" multiple />
            <input type="submit" value="Upload" />
        </div>
    </form>
</div>

@section scripts{
    <!-- Dropzone.js -->
    <script src="~/Scripts/vendors/dropzone/dist/min/dropzone.min.js"></script>
    <script type="text/javascript">
        //File Upload response from the server
        Dropzone.options.dropzoneForm = {
            init: function () {
                this.on("complete", function (data) {
                    //var res = eval('(' + data.xhr.responseText + ')');
                    var res = JSON.parse(data.xhr.responseText);
                });
            },
            uploadMultiple: true,
            addRemoveLinks: true,
            removedfile: function (file) {
                var _ref;
                return (_ref = file.previewElement) != null ? _ref.parentNode.removeChild(file.previewElement) : void 0;
            }
        };
    </script>

}